#ifndef FX_H
#define FX_H


class Fx
{
public:
    Fx() : mInitialized(false), mFxStartTime(0), mFxEndTime(1000.0), mRenderStartTime(0), mRenderEndTime(1000.0) {}
    virtual ~Fx() { if (mInitialized) deinit(); mInitialized = false; }

    void setFxTimes(double startTime, double endTime) { mFxStartTime = startTime; mFxEndTime = endTime; }
    void setRenderTimes(double startTime, double endTime) { mRenderStartTime = startTime; mRenderEndTime = endTime; }

    virtual bool init() { mInitialized = true; return true; }
    virtual void deinit() { mInitialized = false; }

    virtual void render(double time, int timeMs) = 0;

    bool mInitialized;

    // Fx start & end time in seconds
    // Note that fx could be rendered outside these time as well, for transitions or something
    double mFxStartTime, mFxEndTime;
    // Render start & end time in seconds (this range should be equal or larger than the fx start/end time above)
    double mRenderStartTime, mRenderEndTime;
};


#endif // !FX_H
